<div ng-init="init();" class="kmi-layout-content B0301-content">
    <div class="kmi-header-row">
        <div class="kmi-side-btn left" ng-click="back();">
            <i class="material-icons">&#xE408;</i>
            <div class="kmi-can-click"></div>
        </div>
        <div class="brand-title">
            <div class="custom" ng-if="companyName">
                <div class="title" ng-bind="companyName"></div>
                <img src="" alt="" class="brand">
                <div class="gap"></div>
            </div>
            <div class="digiwin">
                <img src="image/smes_v340/logo_ch.png" alt="">
                <img src="image/smes_v340/logo_en.png" alt="">
            </div>
        </div>
        <div class="header-title" ng-bind="'B0301.title' | translate"></div>
        <div class="header-logo"></div>
    </div>
    <div class="kmi-layout-main-content">
        <div class="kmi-layout-page">
            <div class="search">
                <div class="kmi-text-fields" style="margin-bottom: 0px;">
                    <label class="label" ng-bind="'B0301.plot_no' | translate"></label>
                    <input ng-model="adjustInfo.plot_no" ng-keypress="barcodeScan($event)"></input>
                    <div class="kmi-button kmi-button-confrim btn-confirm" ng-click="search()"
                         style="width:100px">
                        <label ng-bind="'B0301.search' | translate"></label>
                        <div class="kmi-can-click"></div>
                    </div>
                </div>
            </div>
            <div class="grid-content adjustment_currently_detail" ng-class="{'is-hide':adjustInfo.adjustment_currently_detail_hide}">
                <div class="content-title">
                    <div class="close-btn" ng-class="{'is-closed':adjustInfo.adjustment_currently_detail_hide}">
                        <i class="material-icons close">remove</i>
                        <i class="material-icons open">add</i>
                        <div class="kmi-can-click"></div>
                    </div>
                    <label ng-bind="'B0301.plot_title' | translate" style="font-weight: bold;padding-top: 8px;"></label>
                    <div class="kmi-can-click" ng-click="toggleContent('adjustment_currently_detail_hide')"></div>
                </div>
                <div class="kmi-list work-list" column-selector-id ="current_quantity_adjustment">
                    <div class="kmi-list__header">
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.plot_details.column1' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.plot_details.column2' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.plot_details.column3' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.plot_details.column4' | translate"></div>
                    </div>
                    <div class="kmi-list__row-content">
                        <div class="kmi-list__row" ng-repeat="data in adjustInfo.adjustment_currently_detail track by $index" style="height:36px;">
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.op_no"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.op_name"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.qty"></div>
                            <div class="kmi-list__column column-input" style="flex:1;">
                                <input type="text" ng-class="{'is-change':data.qty !=data.change_qty}"  mdl-calculater="data.change_qty" mdl-calculater-decimal-length="3">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="grid-content adjustment_detail" ng-class="{'is-hide':adjustInfo.adjustment_detail_hide}">
                <div class="content-title">
                    <div class="close-btn" ng-class="{'is-closed':adjustInfo.adjustment_detail_hide}">
                        <i class="material-icons close">remove</i>
                        <i class="material-icons open">add</i>
                        <div class="kmi-can-click"></div>
                    </div>
                    <label ng-bind="'B0301.adjustment_title' | translate" style="font-weight: bold;margin-right: 20px;padding-top: 8px;"></label>
                    <div class="kmi-can-click" ng-click="toggleContent('adjustment_detail_hide')"></div>
                    <!-- 20180518 modify by Dustdusk for 隱藏無用欄位
                    <label ng-bind="('B0301.before_qty' | translate) + total_ori_qty"  style="margin-right: 20px;padding-top: 8px;"></label>
                    <label ng-bind="('B0301.after_qty' | translate) + total_change_qty"  style="margin-right: 20px;padding-top: 8px;"></label>
                    -->
                </div>
                <!-- 20220428 modify by Alan for#95492 : 新增出站數量(inputqty)， 良數(修)設為不可修改 -->
                <!-- 20220613 modify by Alan for#95492 : 新增多於數、短少數 -->
                <div class="kmi-list column-selector work-list" column-selector-id ="process_adjustment">
                    <div class="kmi-list__header" style="align-items: center;justify-content: center;text-align:center;">
                        <div class="kmi-list__column" style="flex:0 0 40px;" column-name="{{'B0301.adjustment_detail.column9' | translate}}"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column1' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column2' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column10' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column13' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.inputqty' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column3' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column4' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.surplusQty' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.lackQty' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column5' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column6' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column7' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column8' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column12' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column14' | translate"></div>
                        <div class="kmi-list__column" style="flex:1;" ng-bind="'B0301.adjustment_detail.column11' | translate"></div>
                    </div>
                    <div class="kmi-list__row-content" style="align-items: center;justify-content: center;text-align:center;">
                        <div class="kmi-list__row" ng-repeat="data in adjustInfo['adjustment_detail'] track by $index" style="height:36px;">
                            <div class="kmi-list__column column-border" style="flex:0 0 40px;">
                                <button class="mdl-button mdl-js-button mdl-button--icon" ng-click="loadHistory(data);">
                                    <i class="material-icons">history</i>
                                </button>
                            </div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.op_no"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.op_name"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.EventTime"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.EQUIPMENTNO"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.inputqty"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.ori_quality"></div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.ori_defect"></div>
                            <div class="kmi-list__column column-border column-input" style="flex:1;">
                                <div class="num"
                                    ng-class="{ 'is-change': ori_surplus_qty_total[$index] != change_surplus_qty_total[$index] }"
                                    ng-bind="change_surplus_qty_total[$index]" >
                                </div>
                            </div>
                            <div class="kmi-list__column column-border column-input" style="flex:1;">
                                <div class="num"
                                    ng-class="{ 'is-change': ori_lack_qty_total[$index] != change_lack_qty_total[$index] }"
                                    ng-bind="change_lack_qty_total[$index];" >
                                </div>
                            </div>
                            <!--20210412 Modify by johnsyu for#89899：調帳作業增加多人產量修改的功能-->
                            <div class="kmi-list__column column-border column-input" style="flex:1;">
                                <span ng-if="!data.modifiable" ng-bind="data.change_quality" ng-disabled="data.erp_no" />
                                <input ng-if="data.modifiable" type="text" readonly="readonly" ng-class="{'is-change':data.change_quality !=data.ori_quality}"
                                       ng-value="data.change_quality" disabled="disabled" />
                            </div>
                            <div class="kmi-list__column column-border column-input" style="flex:1;">
                                <span ng-if="!data.modifiable" ng-bind="data.change_defect" ng-disabled="data.erp_no" />
                                <input ng-if="data.modifiable" type="text" readonly="readonly" ng-class="{'is-change':data.is_defect_change == 'Y'}"
                                       ng-value="data.change_defect" ng-click="loadAbnormalDetail(data, $index);" ng-disabled="data.erp_no" />
                            </div>
                            <div class="kmi-list__column column-border column-input" style="flex:1;">
                                <span ng-if="!data.modifiable" ng-bind="data.change_labor_hours" ng-disabled="data.erp_no" />
                                <input ng-if="data.modifiable" ng-class="{'is-change':data.change_labor_hours !=data.labor_hours}"
                                       ng-model="data.change_labor_hours" ng-click="changeLaborHours(data);" ng-disabled="data.erp_no" readonly />
                            </div>
                            <div class="kmi-list__column column-input" style="flex:1;">
                                <span ng-if="!data.modifiable" ng-bind="data.change_machine_hours" ng-disabled="data.erp_no" />
                                <input ng-if="data.modifiable" ng-class="{'is-change':data.change_machine_hours !=data.machine_hours}"
                                       mdl-calculater="data.change_machine_hours" mdl-calculater-decimal-length="3" ng-disabled="data.erp_no" />
                            </div>
                            <div class="kmi-list__column column-border" style="flex:1;" ng-bind="data.RWOMESNO"></div>
                            <div class="kmi-list__column column-border" >
                                <div class="kmi-button kmi-button-confrim btn-confirm" style="max-width:100px;margin: 0px auto;" ng-disabled="!data.multiemp_enable" ng-bind="'B0301.adjustment_detail.column15' | translate" ng-click="data.multiemp_enable &&  multiple_open(data);"></div>
                            </div>
                            <div class="kmi-list__column column-border kmi-list__column column-border" style="flex:1;" ng-bind="data.erp_no"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="kmi-layout-footer">
            <button class="mdl-button mdl-js-button mdl-button--fab mdl-shadow--custom mdl-button--custom1"
                    ng-click="confirm();">
                <i class="material-icons">done</i>
            </button>
        </div>
    </div>
</div>
